using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace CMSApplication.Models.Mapping
{
    public class cms_sitesMap : EntityTypeConfiguration<cms_sites>
    {
        public cms_sitesMap()
        {
            // Primary Key
            this.HasKey(t => t.site_id);

            // Properties
            this.Property(t => t.site_url_ref)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.site_title)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.site_content)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("cms_sites");
            this.Property(t => t.site_id).HasColumnName("site_id");
            this.Property(t => t.site_url_ref).HasColumnName("site_url_ref");
            this.Property(t => t.site_title).HasColumnName("site_title");
            this.Property(t => t.site_content).HasColumnName("site_content");
        }
    }
}
